#-*-coding:utf-8-*-

from urllib import urlopen
from bs4 import BeautifulSoup

text = urlopen('http://www.douban.com').read()
soup = BeautifulSoup(text)

#print soup

jobs = set()
for header in soup('h2'):
    #print header
    links = header('a')
    print links
    if not links: continuec
    link = links[0]
    jobs.add('%s (%s)' % (link.string, link['href']))

#print '\n'.join(sorted(jobs, key=lambda s: s.lower()))
